package com.kai.service.Impl;

import com.kai.dao.CoachMapper;
import com.kai.dao.CourseMapper;
import com.kai.dao.CourseTypeMapper;
import com.kai.pojo.Coach;
import com.kai.pojo.Course;
import com.kai.pojo.CourseType;
import com.kai.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseTypeMapper courseTypeMapper;
    @Autowired
    private CoachMapper coachMapper;
    @Autowired
    private CourseMapper courseMapper;
    @Override
    public List<CourseType> selectAllType() {
        return courseTypeMapper.selectAllType();
    }

    @Override
    public List<Coach> selectCoach() {
        return coachMapper.selectCoach();
    }

    @Override
    public int updateCourse(Course course, int ctid, String cid) {
        return courseMapper.updateCourse(course,ctid,cid);
    }

    @Override
    public int addCourse(Course course, int ctid, String cid) {
        return courseMapper.addCourse(course,ctid,cid);
    }

    @Override
    public List<Course> selectAllCourse(String name, int i, int pageSize) {
        return courseMapper.selectAllCourse(name,i,pageSize);
    }

    @Override
    public int selectAllCourseCount(String name) {
        return courseMapper.selectAllCourseCount(name);
    }

    @Override
    public int deleteCourse(String id) {
        return courseMapper.deleteCourse(id);
    }

    @Override
    public int selectCourseByName(String name) {
        return courseMapper.selectCourseByName(name);
    }

    @Override
    public List<Course> selectCourse(String coach_id,String courseType_id) {
        return courseMapper.selectCourse(coach_id,courseType_id);
    }

    @Override
    public Course selectCourseById(String id) {
        return courseMapper.selectCourseById(id);
    }
}
